<template>
	<view class="container">
		<view class="test-title">{{curNum}}/{{totalNum}}</view>
		
		<view class="question-box">
			<view class="question-title">1、刀剑神域中你最喜欢哪个女性角色？</view>
			<view class="answer-box">
				<view class="answer-item" @tap="tapItem" v-for="(item,index) in answerList" :data-index="index">
					<view class="answer-img">
						<image src="../../static/images/no_check.png" v-if="item.isChecked == 0"></image>
						<image src="../../static/images/correct.png" v-if="item.isChecked == 1"></image>
					</view>
					<view class="answer-label">{{item.label}}</view>
				</view>
			</view>
		</view>
		
		<view class="next-box" @tap="next">
			<image src="../../static/images/next.png"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				selectIndex: -1,
				totalNum: 50,
				curNum: 1,
				answerList: [
					{id: 1, label: "A.结衣", isChecked: 0},
					{id: 2, label: "B.亚丝娜", isChecked: 0},
					{id: 3, label: "C.诗音", isChecked: 0},
					{id: 4, label: "D.爱丽丝", isChecked: 0},
				]
			}
		},
		
		methods: {
			
			tapItem(e) {
				if (this.selectIndex > -1) {
					this.answerList[this.selectIndex].isChecked = 0
				}
				this.selectIndex = e.currentTarget.dataset.index
				this.answerList[this.selectIndex].isChecked = 1
			},
			
			next() {
				uni.navigateTo({
					url: '/pages/into_university_matching_result/into_university_matching_result'
				})
			}
			
		}
	}
</script>

<style>
	page {
		background-color: #f7f9fe;
	}
	
	.container {
		width: 750rpx;
		height: auto;
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	
	.test-title {
		font-size: 32rpx;
		color: #333333;
		margin-top: 40rpx;
	}
	
	.question-box {
		width: 680rpx;
		height: auto;
		background-color: #ffffff;
		border-radius: 30rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-top: 40rpx;
	}
	
	.question-title {
		width: 600rpx;
		font-size: 32rpx;
		margin-top: 40rpx;
		font-weight: bold;
	}
	
	.answer-box {
		width: 540rpx;
		margin-top: 40rpx;
		margin-bottom: 50rpx;
	}
	
	.answer-item {
		display: flex;
		flex-direction: row;
		align-items: center;
		height: 90rpx;
	}
	
	.answer-label {
		margin-left: 40rpx;
		font-size: 30rpx;
	}
	
	.answer-img {
		margin-top: 14rpx;
	}
	
	.answer-img image {
		width: 56rpx;
		height: 56rpx;
	}
	
	.next-box {
		margin-top: 60rpx;
	}
	
	.next-box image {
		width: 130rpx;
		height: 130rpx;
	}
</style>
